package com.pipe.servicepipe.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pipe.servicepipe.entity.PipeDebt;
import com.pipe.servicepipe.entity.vo.PipeDebtQuery;
import com.pipe.servicepipe.mapper.PipeDebtMapper;
import com.pipe.servicepipe.service.PipeDebtService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 欠款记录表 服务实现类
 * </p>
 *
 * @author hetao
 * @since 2020-07-12
 */
@Service
public class PipeDebtServiceImpl extends ServiceImpl<PipeDebtMapper, PipeDebt> implements PipeDebtService {
    @Resource
    private PipeDebtMapper pipeDebtMapper;

    @Override
    public void findByPage(Page<PipeDebt> page, PipeDebtQuery pipeDebtQuery) {
        QueryWrapper wrapper = new QueryWrapper();
        // baseMapper.selectPage(page,)
    }

    @Override
    public void deleteBySid(String sid) throws Exception {
        Map map = new HashMap();
        map.put("sid",sid);
        this.baseMapper.deleteByMap(map);
    }

    @Override
    public void deleteBatchBySid(List id) throws Exception{
        pipeDebtMapper.deleteByIds(id);
    }
}
